/**
 * 统一响应接口
 * 与PHP/Java框架保持基本一致的格式，并添加timestamp字段
 * 
 * PHP格式: {data, msg, code}
 * Java格式: {code, msg, data}
 * NestJS格式: {code, msg, data, timestamp} (与Java基本一致，添加timestamp)
 */

export interface ApiResponse<T = any> {
  code: number;
  msg: string;
  data?: T;
  timestamp: string;
}

export interface PaginationMeta {
  page: number;
  limit: number;
  total: number;
  totalPages: number;
  hasNext: boolean;
  hasPrev: boolean;
}

export interface PaginatedResponse<T = any> extends ApiResponse<T[]> {
  meta: PaginationMeta;
}

export interface ErrorResponse extends ApiResponse {
  code: 0;
  msg: string;
  data?: any;
  timestamp: string;
  error?: {
    code: string;
    message: string;
    statusCode: number;
    timestamp: string;
    path?: string;
    details?: any;
  };
}
